﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:Find="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/DeepEarth.BingMapsToolkit.Client.Common;component/Resources/CommonStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="Find:FindControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Find:FindControl">
                    <Canvas x:Name="LayoutRoot" Width="250" Height="70" Opacity="0.82">
                        <Canvas.Resources>
                            <DataTemplate x:Key="ItemDataTemplate">
                                <TextBlock Text="{Binding Path=DisplayName}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </Canvas.Resources>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.3000000"/>
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard/>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="25" />
                                <ColumnDefinition Width="25" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <TextBlock Text="Find" Foreground="White" Grid.Column="0" Grid.Row="0" FontSize="12" Height="20" />
                            <Image x:Name="PART_LoadingIndicator" Source="/DeepEarth.BingMapsToolkit.Client.Controls.Find;component/Images/loading.png" Grid.Column="1" Grid.Row="0" Height="20" Visibility="Collapsed"></Image>
                            <Button x:Name="PART_ClearFind" Grid.Column="2" Grid.Row="1" Style="{StaticResource ButtonStyle}" Height="20" ToolTipService.ToolTip="Rensa">
                                <Image Source="/DeepEarth.BingMapsToolkit.Client.Controls.Find;component/Images/clear.png"></Image>
                            </Button>
                            <TextBox x:Name="PART_FindSearchbox" Grid.Column="0" Grid.Row="1" Width="200" Style="{StaticResource TextBoxStyle}" FontSize="12" Height="25" />
                            <Button x:Name="PART_TriggerFind" Grid.Column="1" Grid.Row="1" Style="{StaticResource ButtonStyle}" Height="20" ToolTipService.ToolTip="Sök" >
                                <Image Source="/DeepEarth.BingMapsToolkit.Client.Controls.Find;component/Images/search.png"></Image>
                            </Button>
                        </Grid>
                        <ListBox x:Name="PART_SearchResults" MinWidth="200" ItemTemplate="{StaticResource ItemDataTemplate}" Canvas.ZIndex="1000000" Canvas.Top="44" FontSize="12" Style="{StaticResource ListBoxStyle}" ItemContainerStyle="{StaticResource ListBoxItemStyle}" Visibility="Collapsed" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

